package com.website.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;

/**
 * 管理员表
 *
 * @author yanqb
 * @since 2018-11-16
 */
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
	@TableId(value="id", type= IdType.AUTO)
	private Integer id;

    /**
     * 头像
     */
	private String avatar;

    /**
     * 账号
     */
	private String account;

    /**
     * 密码
     */
	private String password;

    /**
     * md5密码盐
     */
	private String salt;

    /**
     * 名字
     */
	private String name;

    /**
     * 生日
     */
	private Date birthday;

    /**
     * 性别（1：男 2：女）
     */
	private Integer sex;

    /**
     * 电子邮件
     */
	private String email;

    /**
     * 电话
     */
	private String phone;

    /**
     * 部门id
     */
	@TableField("dept_id")
	private Integer deptId;

	/**
	 * 行政级别(1：高级管理  2：普通管理  ）
	 */
	private Integer level;

    /**
     * 状态(1：启用  2：冻结  3：删除）
     */
	private Integer state;

    /**
     * 创建时间
     */
	@TableField("create_time")
	private Date createTime;

    /**
     * 保留字段
     */
	private String version;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getDeptId() {
		return deptId;
	}

	public void setDeptId(Integer deptId) {
		this.deptId = deptId;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "User{" +
				"id=" + id +
				", avatar=" + avatar +
				", account=" + account +
				", password=" + password +
				", salt=" + salt +
				", name=" + name +
				", birthday=" + birthday +
				", sex=" + sex +
				", email=" + email +
				", phone=" + phone +
				", deptId=" + deptId +
				", level=" + level +
				", state=" + state +
				", createTime=" + createTime +
				", version=" + version +
				"}";
	}

}
